<%--
  Created by IntelliJ IDEA.
  User: 钱多多的钱罐罐
  Date: 2022/3/17
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
   // String username=request.getParameter("username");
    String username=(String)session.getAttribute("user");
    if (username==null){
        response.sendRedirect("login.jsp");
    }
    //获取sessionid
    String id=(String)session.getId();

    out.print(username+"<br/>");
    out.print(id+"<br/>");
    //获取cookies信息
    Cookie[]cookies=request.getCookies();
    for (int i=0;i<cookies.length;i++){
        out.print(cookies[i].getName()+"<br/>");
        out.print(cookies[i].getValue()+"<br/>");
    }
%>
        登录成功！
</body>
</html>
